package com.ego.product.service.impl;

import com.ego.product.vo.AttrGroupRelationVo;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ego.product.dao.AttrGroupRelationDao;
import com.ego.product.po.AttrGroupRelation;
import com.ego.product.service.AttrGroupRelationService;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author KamTang
 * @program: ego
 * @description 属性&属性分组关联对应实现类
 * @date 2022-11-13 12:56:14
 */
@Service("attrGroupRelationService")
public class AttrGroupRelationServiceImpl extends ServiceImpl<AttrGroupRelationDao, AttrGroupRelation> implements AttrGroupRelationService {
    @Override
    public void saveBatch(List<AttrGroupRelationVo> vos) {
        List<AttrGroupRelation> collect = vos.stream().map(AttrGroupRelation::fromVo).collect(Collectors.toList());
        this.saveBatch(collect);
    }
}
